<div style="padding-right: 15px">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">当前:</label>
            <div class="layui-input-block">
                <input style="color: red;width: 100px;border: 0" type="text" name="bill_scale" lay-verify="title" class="layui-input" disabled>
            </div>
        </div>
        <hr>
        <div class="layui-form-item">
            <label class="layui-form-label">出:</label>
            <div class="layui-input-block">
                <input  type="text" name="scale_pay" lay-verify="title" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">收:</label>
            <div class="layui-input-block">
                <input  type="text" name="scale_sell" lay-verify="title" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn btn_edit_scale_save">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script>
    $(function () {
        $.getJSON ("getConfig", function (result) {
            var data=result["data"][0];
            $("input[name='bill_scale']").val(data["scale_pay"] +  "   :  " + data["scale_sell"]);
            $("input[name='scale_pay']").val(data["scale_pay"]);
            $("input[name='scale_sell']").val(data["scale_sell"]);
        });
    });
    $(".btn_edit_scale_save").click(function () {
        var scale_pay=$("input[name='scale_pay']").val()
            ,scale_sell=$("input[name='scale_sell']").val();
        if(scale_pay != "" && scale_sell != ""){
            $.ajax({
                type : "get"
                ,url : "EditScale"
                ,data : {
                    scale_pay :scale_pay
                    ,scale_sell :scale_sell
                }
                ,success:function (result) {
                    if(result > 0){
                        /*layui.use('layer', function(){
                            var layer = layui.layer;
                            layer.msg("修改成功，目前比例：出"+scale_pay+"  收" + scale_sell,{time:1000,maxWidth:300});
                        });*/
                        layer.msg("修改成功，目前比例：出"+scale_pay+"  收" + scale_sell,{time:1000,maxWidth:160});
                        //alert("修改成功，目前比例：出"+scale_pay+"  收" + scale_sell);

                        layer.closeAll();
                    }else {

                        layer.msg('修改失败',{time:1000,maxWidth:160});
                    }
                }
            });
        }else{
            alert("请填写完整信息");
        }
    });
</script>